package com.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.model.Post;
import com.model.ScreenResume;
import com.service.ScreenResumeService;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 简历评估表 前端控制器
 * </p>
 *
 * @author Damon
 * @since 2021-04-29
 */
@RestController
@RequestMapping("/screen-resumegeren")
public class ScreenResumegerenController {
    //  列表数据  支持分页和条件查询
    @Autowired
    private ScreenResumeService screenResumeService;


    //列表数据
    @Autowired
    HttpServletRequest request; //通过注解获取一个request

    @RequestMapping("/pingjiajieguolist")
    /*public Page<ScreenResume> list(Long pageNum, Long size){
        //分页对象
        Page<ScreenResume> page = new Page<ScreenResume>(pageNum, size);
        page = screenResumeService.listPage(page);
        return page;
    }*/
    public Page<ScreenResume> list(String userKeyS,Long pageNum, Long size){
        //分页对象
        Page<ScreenResume> page = new Page<ScreenResume>(pageNum, size);
        page = screenResumeService.listPage(page,new ScreenResume(userKeyS));
        return page;
    }

    //列表数据
    @RequestMapping("/listAll")
    public List<ScreenResume> listAll(){
        List<ScreenResume> list = screenResumeService.list();
        return list;
    }


//    @RequestMapping("/getById")
//    public ScreenResume getByEmpno(int id){
//        return screenResumeService.getById(id);
//    }


    //专家评估 增加评估结果
    @RequestMapping("/add")
    public boolean add(@RequestBody ScreenResume screenResume){
        return screenResumeService.save(screenResume);
    }


}

